#ifndef __DALELIB_TIMER_H__
#define __DALELIB_TIMER_H__

#include <mmsystem.h>

namespace dalelib
{

// timer code from here:
// http://blog.kowalczyk.info/article/High-resolution-timer-for-timing-code-fragments.html
struct
{
    void Start(void) { QueryPerformanceCounter(&mTimeStart); };
    void Stop(void) { QueryPerformanceCounter(&mTimeStop); };
    float GetTimeInterval(void)
    {
        LARGE_INTEGER freq;
        QueryPerformanceFrequency(&freq);
        float duration = (float)(mTimeStop.QuadPart-mTimeStart.QuadPart)/(float)freq.QuadPart;
        return duration;
    }

    LARGE_INTEGER mTimeStart;
    LARGE_INTEGER mTimeStop;
} ProfTimer;

} // namespace dalelib


#endif
